<?php
/**
 * Created by PhpStorm.
 * User: My
 * Date: 2018/10/8
 * Time: 10:58
 */

namespace App\Http\Helper;

use TestingConfig;

class BusinessHelper
{
    /**
     * 获取付费测评的ID
     * @return mixed
     */
    public static function getDimensionPayTid() {
        return intval(TestingConfig::getValue('five.dimension.testing.pay.id', 93));
    }

    /**
     * 获取public测评的ID
     * @return mixed
     */
    public static function getDimensionPublicTid() {
        return intval(TestingConfig::getValue('five.dimension.testing.id', 92));
    }

    /**
     * 获取配置信息
     * @param $type
     * @param $config
     * @return array|mixed
     */
    public static function getConfig($type, $config) {
        switch ($type) {
            case 'five_dimension_care_linker':
                return json_decode(TestingConfig::getValue('five.dimension.care.linker.' . $config, '{}', false), true);
            default:
                return [];
        }
    }

    /**
     * 获取维度测评分值对应的信息
     * @return mixed
     */
    public static function getDimensionScoreConfig() {
        return json_decode(TestingConfig::getValue('dimension.score.config', '{}', false), true);
    }

    /**
     * 获取可以修改信息的测评id
     * @return mixed
     */
    public static function getDimensionV2Tids() {
        return json_decode(TestingConfig::getValue('dimension.v2.tids', '{}', false), true);
    }

    /**
     * 获取智美的测评的ID
     * @return mixed
     */
    public static function getDimensionZmTids() {
        return json_decode(TestingConfig::getValue('dimension.zm.tids', '{}', false), true);
    }

    /**
     * 获取可以修改答案信息的测评id
     * @return mixed
     */
    public static function getDimensionChangeTids() {
        return json_decode(TestingConfig::getValue('dimension.change.tids', '{}', false), true);
    }

    /**
     * 使用新版结果页的测评ID
     * @return mixed
     */
    public static function getDimensionNewResultTids() {
        return json_decode(TestingConfig::getValue('dimension.new.result.tids', '{}', false), true);
    }

    /**
     * 可以做测评的TID
     * @return mixed
     */
    public static function canTestingTids() {
        return json_decode(TestingConfig::getValue('can.testing.tids', '{}', false), true);
    }

    /**
     * 获取账户中心的链接
     * @return mixed
     */
    public static function getAccountUrl() {
        return TestingConfig::getValue('account.account_center_url');
    }

    /**
     * 获取形体测评的测评链接
     * @return mixed
     */
    public static function getPhysiqueQnUrl() {
        return TestingConfig::getValue('physique.qn.url');
    }
}